﻿using IDEAMS.model;
using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;

namespace IDEAMS.common.converter
{
    public class DeviceStatusToColorConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is DeviceStatus)
            {
                switch ((DeviceStatus)value)
                {
                    case DeviceStatus.NORMALI:
                        return Brushes.AliceBlue;
                    case DeviceStatus.RUNNING:
                        return Brushes.Aqua;
                    case DeviceStatus.KJ_FINISH:
                        return Brushes.Green;
                    case DeviceStatus.FINISH:
                        return Brushes.Blue;
                    case DeviceStatus.ALARM:
                        return Brushes.Red;
                    default:
                        return Brushes.Transparent; // 默认颜色
                }
            }
            return Brushes.Transparent;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
